package btp.Calendars.Tests;

import btp.Calendars.GregorianCalendar;
import btp.Calendars.RataDie;

public class GregorianCalendarTest {

	public static void main(String[] args){
		//Test one: 10 March, 1992 is Tuesday.
		GregorianCalendar g = new GregorianCalendar(1992, GregorianCalendar.MARCH, 10);
		long rd = g.getRDFromGregorian();
		String day = RataDie.getStringForDay(RataDie.dayOfWeek(rd));
		System.out.println(day);
		
		//Test Two: Reverse conversion
		g = GregorianCalendar.getDayFromRD(rd);
		System.out.println(g.getDay()+"-"+GregorianCalendar.getStringForMonth(g.getMonth())+"-"+g.getYear());
		
		//Test three: Thanksgiving in 2012, 4th Tuesday in October.
		g = new GregorianCalendar(2012, GregorianCalendar.OCTOBER, 1);
		g = g.nthDay(4, RataDie.TUESDAY);
		System.out.println(g.getDay()+"-"+GregorianCalendar.getStringForMonth(g.getMonth())+"-"+g.getYear());
	}
}
